package cn.iocoder.yudao.module.measure.dal.mysql.point;



import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.measure.controller.admin.point.VO.MeasurePointInfoPageReqVO;
import cn.iocoder.yudao.module.measure.dal.dataobject.point.MeasurePointInfoDO;
import cn.iocoder.yudao.module.measure.dal.dataobject.upload.BusinessDeviceUploadData;
import cn.iocoder.yudao.module.measure.dal.dataobject.upload.MeasureData;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * 测量点信息表
 * </p>
 *
 * @author zhengbzh
 * @date 2025-06-09 16:47:58
 * @create [2025-06-09 16:47:58] [zhengbzh] [代码生成器生成]
 */
@Mapper
public interface BusinessMeasurePointInfoMapper extends BaseMapperX<MeasurePointInfoDO> {

    List<BusinessDeviceUploadData> queryMeasureData(MeasureData queryParams);

    default PageResult<MeasurePointInfoDO> selectPage(MeasurePointInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MeasurePointInfoDO>()
                .betweenIfPresent(MeasurePointInfoDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(MeasurePointInfoDO::getDeviceTreeId, reqVO.getDeviceTreeId())
                .likeIfPresent(MeasurePointInfoDO::getMeasurePointName, reqVO.getMeasurePointName())
                .eqIfPresent(MeasurePointInfoDO::getMeasurePointNo, reqVO.getMeasurePointNo())
                .eqIfPresent(MeasurePointInfoDO::getDtuInfoId, reqVO.getDtuInfoId())
                .eqIfPresent(MeasurePointInfoDO::getProtocolId, reqVO.getProtocolId())
                .eqIfPresent(MeasurePointInfoDO::getCtRate, reqVO.getCtRate())
                .eqIfPresent(MeasurePointInfoDO::getPtRate, reqVO.getPtRate())
                .eqIfPresent(MeasurePointInfoDO::getMeasureMeterNo, reqVO.getMeasureMeterNo())
                .eqIfPresent(MeasurePointInfoDO::getMeasureMeterContant, reqVO.getMeasureMeterContant())
                .betweenIfPresent(MeasurePointInfoDO::getInstallDate, reqVO.getInstallDate())
                .eqIfPresent(MeasurePointInfoDO::getConnectWay, reqVO.getConnectWay())
                .eqIfPresent(MeasurePointInfoDO::getVoltageType, reqVO.getVoltageType())
                .eqIfPresent(MeasurePointInfoDO::getCurrentType, reqVO.getCurrentType())
                .eqIfPresent(MeasurePointInfoDO::getRegId, reqVO.getRegId())
                .orderByDesc(MeasurePointInfoDO::getId));
    }
}


